import { request, DEFAULT_BASE_URL, getToken } from "@/utils/request.js";

// 获取选填信息
export function getOptionalInfo() {
    return request({
        url: `/api/v1/hospital/consent/optional/info`,
        method: "get",
    });
}

// 获取中药列表
export function getDrugs(data) {
    return request({
        url: `/api/v1/hospital/drugs?pageSize=${data.pageSize}&page=${data.page}&name=${data.name}`,
        method: "get",
    });
}

// 根据code获取字典
export function getDict(data) {
    return request({
        url: `/api/v1/hospital/dict?code=${data.code}`,
        method: "get",
    });
}

// 获取疾病列表
export function getDisease(data) {
    return request({
        url: `/api/v1/hospital/disease?pageSize=${data.pageSize}&page=${data.page}&fjbname=${data.fjbname}`,
        method: "get",
    });
}

// 提交中药处方
export function treatmentRecordChineseMedicine(data) {
    return request({
      url: '/api/v1/hospital/treatmentRecord/chinese/medicine',
      method: 'POST',
      data
    })
  }

// 获取中药处方列表
export function getTreatmentRecordChineseMedicineList(data) {
    return request({
        url: `/api/v1/hospital/treatmentRecord/chinese/medicine?pageSize=${data.pageSize}&page=${data.page}`,
        method: "get",
        data: data
    });
}

// 获取中药处方详情
export function getTreatmentRecordChineseMedicineDetail(outpatient_no) {
    return request({
        url: `/api/v1/hospital/treatmentRecord/chinese/medicine/${outpatient_no}`,
        method: "get",
        showLoading: false,
    });
}

// 获取知情说明书
export function getConsentForm(id) {
    return request({
        url: `/api/v1/hospital/consent/${id}`,
        method: "get",
        showLoading: false,
    });
}
